package com.itheima.core.test;

import org.junit.Test;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
public class select {
	@Test
	public void selectTest() {
		/***
		 * 注意chromedriver和上传文档的路径，添加selenium的相关jar包
		 * 谢旻熹贡献
		 */
		System.setProperty("webdriver.chrome.driver", "C:\\Program Files (x86)\\Google\\Chrome\\Application\\chromedriver.exe");
		WebDriver driver = new ChromeDriver();
		driver.get("http://localhost:8080/boot-crm/");
		driver.manage().window().maximize(); // 浏览器窗口最大化
		try {
			Thread.sleep(2000);
		} catch (InterruptedException e1) {
			e1.printStackTrace();
		}
		driver.findElement(By.name("usercode")).sendKeys("m0001");
		driver.findElement(By.id("password")).sendKeys("123");;
		driver.findElement(By.id("deng")).click();
		System.out.println("The testing page title is: " + driver.getTitle());
		try {
			Thread.sleep(10000);
		} catch (InterruptedException e1) {
			e1.printStackTrace();
		}
	
	
	driver.quit();
	}
}
